package com.pp.controller;

import com.pp.model.Menu;
import com.pp.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RequestMapping("/api")
@RestController
public class MenuController {

   @Autowired
   private MenuService menuService;
  @GetMapping("/menus")
   public List<Menu> menuList(){

     List<Menu> menus=   menuService.getMenuList();
     return  menus;
  }

}
